#ifndef LOGINPAGE_H
#define LOGINPAGE_H

#include <QMainWindow>
#include <main.h>
//#include "QSettings"
//extern QSettings *settings;
namespace Ui {
class LoginPage;
}

class LoginPage : public QMainWindow
{
    Q_OBJECT

public:
//    explicit LoginPage(QString parameter,QWidget *parent = 0);
    explicit LoginPage(QWidget *parent = 0);
//    explicit LoginPage() {
//            setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);
//            setAttribute(Qt::WA_TranslucentBackground);
//            setGeometry(200, 200, 300, 300);

//            setMask(create_mask(rect(), 10));
//        }
    ~LoginPage();


//        QRegion create_mask(const QRect& rect, int radius) {
//            int x = rect.x(), y = rect.y(), w = rect.width(), h = rect.height();

//            QRegion mask(rect, QRegion::Ellipse);

//            // Corners
//            mask = mask.subtracted(QRegion(x, y, radius, radius, QRegion::Ellipse));
//            mask = mask.subtracted(QRegion(x + w - radius, y, radius, radius, QRegion::Ellipse));
//            mask = mask.subtracted(QRegion(x, y + h - radius, radius, radius, QRegion::Ellipse));
//            mask = mask.subtracted(QRegion(x + w - radius, y + h - radius, radius, radius, QRegion::Ellipse));

//            // Edges
//            mask = mask.subtracted(QRegion(x + radius, y, w - 2 * radius, radius));
//            mask = mask.subtracted(QRegion(x, y + radius, radius, h - 2 * radius));
//            mask = mask.subtracted(QRegion(x + w - radius, y + radius, radius, h - 2 * radius));
//            mask = mask.subtracted(QRegion(x + radius, y + h - radius, w - 2 * radius, radius));

//            return mask;
//        }

private slots:

    void on_loginbtn_clicked();

//    qint32 on_loginbtn_clicked();
    void on_checkBox_clicked();

    /*void sendData(qint32)*/
    // ======================鼠标拖动=============
    void mousePressEvent(QMouseEvent *event);
    void mouseMoveEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);
private:
    Ui::LoginPage *ui;
    qint32 state =-1;
    //=======================鼠标拖动==============
    bool m_dragging;
    QPoint m_lastPos;
//    QOpacityEffect *m_opacityEffect;
//signals:
//    void parameterOutput(QString parameter);
//   ==================================================

//    QStringList myList;
    QStringList usernames;
    QStringList passwords;
    QList<int> states;


};

#endif // LOGINPAGE_H
